<%@ include file="/common/taglibs.jsp"%>
<title>DWR(以membershipDwr为例)演示页面</title>
<script type="text/javascript" src="${ctxPath}/dwr/interface/membershipDwr.js?rs=${appConfig.rs}"></script>

<form class="mainForm" action="${ctxPath}">
	<select id="membershipSeclect" name="membershipSeclect" onFocus ="getMemberships()">
		<option>
			---Please Select-----
		</option>
	</select>
</form>
<script type="text/javascript">
function getMemberships(){
	DWRUtil.removeAllOptions($("membershipSeclect"));
	
	var loading = [{
		"membershipId" : "0",
		"membershipName" : "-------Loading,please wait------",
	}];
	DWRUtil.addOptions($("membershipSeclect"),loading,"membershipId","membershipName" );
	
	membershipDwr.getMemberships(callback);
}

function callback(data){
	DWRUtil.removeAllOptions($("membershipSeclect"));	
	DWRUtil.addOptions($("membershipSeclect"), data,"membershipId","membershipName");
}
</script>

